import os

# 字典 value 排序 从大到小
def dict_v_sort_desc(data):
    aps = sorted(data.items(), key=lambda d: d[1], reverse=True)
    return aps


# 字典 value 排序 从小到大
def dict_v_sort_asc(data):
    aps = sorted(data.items(), key=lambda d: d[1], reverse=False)
    return aps


if __name__ == '__main__':
    print("start")
    data = {1: 1, 2: 3, 3: 1, 4: 5}
    print(dict_v_sort_desc(data))
    print(dict_v_sort_asc(data))
    print("end")
